package org.erp.store.infrastructure.convert;

import org.erp.store.domain.dto.ProductRemoteDto;
import org.erp.store.domain.entity.DeviceInventory;
import org.erp.store.domain.bo.DeviceInventoryBo;
import org.erp.store.domain.dto.DeviceInventoryDto;
import org.erp.store.domain.dto.DeviceInventoryMqMessageDto;
import org.erp.store.domain.vo.DeviceInventoryVo;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

import java.util.List;

@Mapper(componentModel = "spring", builder = @org.mapstruct.Builder(disableBuilder = true))
public interface DeviceInventoryConvert {

    @Mappings(value = {})
    DeviceInventoryDto boConvertDto(DeviceInventoryBo deviceInventoryBo);




    @Mappings(value = {})
    DeviceInventoryVo toVo(DeviceInventory deviceInventory);


    @Mappings({
            @Mapping(target = "id", source = "inventoryId"),
            @Mapping(target = "repairPrice", source = "repairPrice"),
            @Mapping(target = "sellPrice", source = "sellPrice"),
            @Mapping(target = "sellerId", source = "sellerId"),
            @Mapping(target = "sellerName", source = "sellerName"),
            @Mapping(target = "transferUserId", source = "transferUserId"),
            @Mapping(target = "transferUserName", source = "transferUserName")
    })
    DeviceInventory messageToDeviceInventory(DeviceInventoryMqMessageDto deviceInventoryMqMessageDto);
    @Mappings({
            @Mapping(target ="stockId" ,source = "id"),
            @Mapping(target ="productName" ,source = "productName"),
            @Mapping(target ="brandId" ,source = "brandId"),
            @Mapping(target ="categoryId" ,source = "categoryId"),
            @Mapping(target ="modelId" ,source = "modelId"),
            @Mapping(target ="seriesId" ,source = "seriesId"),
            @Mapping(target ="levelId" ,source = "levelId"),
            @Mapping(target ="productImei" ,source = "productImei"),
            @Mapping(target ="productCode" ,source = "productCode"),
            @Mapping(target ="productColor" ,source = "productColor"),
            @Mapping(target ="productStorage" ,source = "productStorage"),
            @Mapping(target ="tenantId" ,source = "tenantId"),
            @Mapping(target ="tenantName" ,source = "tenantName"),
            @Mapping(target ="costPrice" ,source = "procurementPrice"),
            @Mapping(target ="dickerPrice" ,source = "procurementPremium")
    })
    List<ProductRemoteDto> ToProductRemoteDto(List<DeviceInventory> deviceInventoryList);
}
